package assignment.ton.gui;

import java.awt.Dimension;
import java.awt.Font;
import java.awt.GridLayout;

import javax.swing.JButton;
import javax.swing.JPanel;

import assignment.ton.def.Util;
import assignment.ton.gui.listener.MenuActionListener;
/**
 * A panel that only shows when a class is selected and then presents the user with options
 */
public class VisibleSelectedPanel extends JPanel{
	private static final long serialVersionUID = 1L;
	private JButton addLink,deleteLink,editLink,editClass,editVariables,editMethods,removeClass;
	private GridLayout grid;
	private MenuActionListener menuListener;
	private MainFrame mainFrame;
	private final Font textFont = new Font("Arial", Font.PLAIN, 11);
	public VisibleSelectedPanel(MainFrame mF){
		setVisible(false);
		this.setPreferredSize(new Dimension(106,160));
		this.setBackground(Util.background());
		mainFrame = mF;
		menuListener = new MenuActionListener(mainFrame);
		grid = new GridLayout(0,1);
		this.setLayout(grid);
		addLink = new JButton("Add Link");
		addLink.setFont(textFont);
		//this.add(addLink);
		editLink = new JButton("Add/Edit Link");
		editLink.setActionCommand("Edit Link");
		editLink.setFont(textFont);
		this.add(editLink);
		editLink.addActionListener(menuListener);
		addLink.addActionListener(menuListener);
		deleteLink = new JButton("Delete Link");
		deleteLink.setFont(textFont);
		this.add(deleteLink);
		deleteLink.addActionListener(menuListener);
		editVariables = new JButton("Variables");
		editVariables.setFont(textFont);
		this.add(editVariables);
		editVariables.addActionListener(menuListener);
		editMethods = new JButton("Methods");
		editMethods.setFont(textFont);
		this.add(editMethods);
		editMethods.addActionListener(menuListener);
		editClass = new JButton("Edit Class");
		editClass.setFont(textFont);
		this.add(editClass);
		editClass.addActionListener(menuListener);
		removeClass = new JButton("Delete Class");
		removeClass.setFont(textFont);
		this.add(removeClass);
		removeClass.addActionListener(menuListener);
	}
}
